package com.ai.web.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ai.web.service.WxRoleService;
import com.ai.web.vo.ResultModel;
import com.ai.web.vo.WxRoleV;
import com.tiny.persistence.domain.WxRole;
import com.tiny.persistence.repository.WxRoleRepo;

@Service
public class WxRoleServiceImpl extends BaseServiceImpl<WxRole, Integer, WxRoleV> implements WxRoleService  {

    @Autowired
    private WxRoleRepo wxRoleRepo;
    
    @Autowired
    public WxRoleServiceImpl(WxRoleRepo wxRoleRepo) {
        super(wxRoleRepo);
    }

    public WxRoleV getRole(int id) throws Exception {
        return getT(id);
    }

    public ResultModel saveRole(WxRoleV WxroleV) throws Exception {
        
        WxRoleV saveV = saveT(WxroleV);
        
        ResultModel rm = new ResultModel();
        rm.setData(saveV);
        rm.setSuccessCode();
        
        return rm;
    }

    public ResultModel deleteRoles(List<Integer> ids) throws Exception {
        deleteTs(ids);
        
        ResultModel rm = new ResultModel();
        rm.setSuccessCode();
        rm.setMsg("删除成功！");
        
        return rm;
    }

	public List<WxRoleV> getRoleList() {
		return wxRoleRepo.getRoleList();
	}
   
}
